Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): Manually set anchors for broken tags #6678

Conversation

charlottetan
Copy link
Contributor

@charlottetan charlottetan commented Jan 23, 2022

What does this PR do?

Related to PR #5810. Fixes issue #6508.
GFM parses anchors differently on Github vs on Github Pages.

Given this markup:

* [0 - MOOC](#0---mooc)
* [Algorithms & Data Structures](#algorithms--data-structures)

### 0 - MOOC
### Algorithms & Data Structures

Github generates this HTML:

<a href="#0---mooc">0 - MOOC</a>
<a href="#algorithms--data-structures">Algorithms &amp; Data Structures</a>

<h3><a id="user-content-0---mooc" href="#0---mooc"></a>0 - MOOC</h3>
<h3><a id="user-content-algorithms--data-structures" href="#algorithms--data-structures"></a>Algorithms &amp; Data Structures</h3>

But Github pages generates this, note the different id and href values:

<a href="#0---mooc">0 - MOOC</a>
<a href="#algorithms--data-structures">Algorithms &amp; Data Structures</a>

<h3 id="mooc">0 - MOOC</h3>
<h3 id="algorithms-amp-data-structures">Algorithms &amp; Data Structures</h3>

Which results in the links working in Github but not on Github pages.

Checklist:

  • Read our contributing guidelines
  • Search for duplicates.
  • Include author(s) and platform where appropriate.
  • Put lists in alphabetical order, correct spacing.
  • Add needed indications (PDF, access notes, under construction)

Follow-up

  • Check the status of GitHub Actions and resolve any reported warnings!

@@ -80,7 +80,7 @@
* [Web Development](#web-development)


### 0 - MOOC
<h3 id="0---mooc">0 - MOOC</h3>
Copy link
Member

@davorpa davorpa Jan 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's take a bit of care.

Should it better use markdown syntax and modify index item? Like in other listings. See C++ in langs 😉

...
* [C++](#cpp)
...


### <a name="cpp"></a>C++

There are currently a parser/app (see #6643) processing the markdown and it's sure that this brokes detecting the section

Apply in the rest of lines 🚀 too

@davorpa davorpa linked an issue Jan 23, 2022 that may be closed by this pull request
@davorpa
Copy link
Member

davorpa commented Jan 23, 2022

As I explain in the issue this is very rare since we have configured GMF as markdown engine since PR #5810.

So, GitHub Pages and GitHub preview have to be rendered with the same result.

@davorpa davorpa self-assigned this Jan 23, 2022
@eshellman eshellman closed this Jan 31, 2022
@EbookFoundation EbookFoundation locked as resolved and limited conversation to collaborators Jan 31, 2022
@davorpa davorpa added the 🐛 BUG Confirmed bugs, normally at GitHub Pages label Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 BUG Confirmed bugs, normally at GitHub Pages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The 0-MOOC and Algorithms and Data Structures anchor tags not working
3 participants